-
Notifications
You must be signed in to change notification settings - Fork 123
storage: storvsc user-mode implementation #1256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
struct StorvscInner { | ||
next_transaction_id: AtomicU64, | ||
new_request_receiver: Receiver<StorvscRequest>, | ||
transactions: Mutex<HashMap<u64, PendingOperation>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use a slab::Slab<PendingOperation>
instead of a HashMap
. The slab will give you a usize
key which you can use as the transaction ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see from the Slab docs that it can reuse keys for removed items. Could there be any issues with reused, non-sequential keys on the storvsp side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be a protocol violation--storvsp can only send a completion for a transaction once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does slab still work for this if it can reuse keys, given that it can result in duplicate transaction IDs?
.0 | ||
.to_owned(); | ||
|
||
// Step 4: CREATE_SUB_CHANNELS (if supported) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really support subchannels yet, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subchannels are seemingly supported by our storvsp implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure but this client doesn't seem to actually do anything with them.
I also don't know if subchannels are supported by the Linux vmbus uio driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(For the use case of accessing low-perf devices, it doesn't matter. But subchannels will be a big deal for high-perf devices.)
|
||
enum Packet { | ||
Completion(StorvscCompletionPacket), | ||
//Data(StorvscDataPacket), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this case will be necessary for supporting hot add/remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the protocol operations be for hot add/remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The driver get an async notification message that something changed, and then it's supposed to rescan the SCSI bus (if even needs to--in the OpenHCL case, we know what LUN to expect, so we can pretty much just silently drop the notification).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After doing nothing, then we need to send a completion for the data packet, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which commands do we need to support receiving in storvsc? I imagine ENUMERATE_BUS is among them, but are there any others?
Looking good! |
Pinging this issue because it still needs reviews |
This is an implementation of the storvsc (client complement to storvsp) for SCSI storage over VMBus.
#273